Adding Single entries:

[Run]
Filename: "{app}\hostsedit.exe"; Parameters: "/a 0.0.0.0 www.google.com"; Flags: runhidden;
Filename: "{app}\hostsedit.exe"; Parameters: "/a 0.0.0.0 google.com"; Flags: runhidden;

[UninstallRun]
Filename: "{app}\hostsedit.exe"; Parameters: "/r www.google.com"; Flags: runhidden;
Filename: "{app}\hostsedit.exe"; Parameters: "/r google.com"; Flags: runhidden;
 

Adding Multiple entries: 

[Run]
//add all entries to hosts file, reading from test.txt.
Filename: "{app}\hostsedit.exe"; Parameters: "/am ""{app}\test.txt"""; Flags: runhidden;
//set readonly attribute for hosts file.
Filename: "{app}\hostsedit.exe"; Parameters: "/attr r"; Flags: runhidden;

[UninstallRun]
//on uninstall remove entries from hosts file.
Filename: "{app}\hostsedit.exe"; Parameters: "/rm ""{app}\test.txt"""; Flags: runhidden;
 

Creating Backup & Restoring the same:

[Run]
//create backup of hosts file to app folder;
Filename: "{app}\hostsedit.exe"; Parameters: "/b ""{app}\HOSTS"""; Flags: runhidden;

[UninstallRun]
//on uninstall restore hosts file from created backup.
Filename: "{app}\hostsedit.exe"; Parameters: "/res ""{app}\HOSTS"""; Flags: runhidden;